from django.conf.urls import url
from . import views
from rest_framework_jwt.views import obtain_jwt_token

urlpatterns = [
    url(r'^sms_codes/(?P<mobile>1[3-9]\d{9})/$',views.Sms_Code_View.as_view()),
    url(r'^usernames/(?P<user>\w+)/count/$',views.UsernameView.as_view()),
    url(r'^mobiles/(?P<mobiles>1[3-9]\d{9})/count/$',views.Check_mobilesView.as_view()),
    url(r'^users/$',views.UsersView.as_view()),
    # url(r'^authorizations/$',obtain_jwt_token),
    url(r'^authorizations/$',views.UserLoginView.as_view()),
    url(r'^user/$',views.UserView.as_view()),
    url(r'^email/$',views.EmailView.as_view()),
    url(r'^emails/verification/$',views.Check_emailView.as_view()),
    url(r'^browse_histories/$',views.BrowseHistoryView.as_view()),
    url(r'^users/(?P<pk>\d+)/password/$',views.UpdatePassWordView.as_view()), #更新密码
    url(r'^image_codes/(?P<image_code_id>.*)/$',views.ImageCodeView.as_view()), #获取图片验证码
    url(r'^accounts/(?P<username>\w+)/sms/token/$',views.Check_UserView.as_view()), #验证用户和图片验证码
    url(r'^sms_codes/$',views.Sms_UserCodeView.as_view()), #发送短信
    url(r'^accounts/(?P<username>\w+)/password/token/$',views.Sms_UserPasswordView.as_view()), #验证短信验证码
    url(r'^users/(?P<pk>\d+)/resetpassword/$',views.UpdateUserPasswordView.as_view()), #重置密码
]